/*
2021-8-12
https://www.acwing.com/problem/content/3804/
*/
#include<cstring>
#include<iostream>
#include<algorithm>

using namespace std;

int main()
{
    int T;
    cin>>T;
    while(T--)
    {
        int maxv=0,len=0,res=0;
        int n,x;
        cin>>n;
        while(n--)
        {
            cin>>x;
            if(maxv<x) maxv=x,len=1,res=1;
            else if(maxv==x) len++,res=max(res,len);
            else len=0;
        }
        cout<<res<<endl;
    }
    return 0;
}
